home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / grafik / raytracing / rayshade-4.0.6.3 / libray / libobj / ifs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-09  |  4.0 KB  |  95 lines

  1. /*
  2.  * ifs.h
  3.  *
  4.  * Philippe Bekaert - bekaert@cs.kuleuven.ac.be - 12 jan 93
  5.  */
  6. #ifndef IFS_H
  7. #define IFS_H
  8. #include "geom.h"
  9. #include "libcommon/transform.h"
  10. #include "libcommon/common.h"
  11.  
  12. #define CONSTANT_NORMAL_WEIGHTING 0
  13. #define HIGHPASS_NORMAL_WEIGHTING 1
  14. #define LOWPASS_NORMAL_WEIGHTING 2
  15.  
  16. #define GeomCIfsCreate(m,c,l,o)    GeomCreate((GeomRef)IfsCreate(m,c,l,o), CIfsMethods())
  17. #define GeomIfsCreate(m,o)    GeomCreate((GeomRef)IfsCreate(m,(Geom *)NULL,(Geom *)NULL,o), IfsMethods())
  18.  
  19. /* list of transforms */
  20. typedef struct IfsTransList {
  21.         Trans *trans, *transtail;       /* head and tail of transforms */
  22.         int rang;
  23.         struct IfsTransList *next;
  24. } IfsTransList;
  25.  
  26. /*
  27.  * Ifs
  28.  */
  29. typedef struct IfsMap {                 /* Ifs map structure */
  30.         Trans *trans, *transtail;       /* head and tail of transformation list */
  31.         RSMatrix matrix, imatrix;       /* matrix and inverse after resolving and composing the transformations */
  32.         Float contractivity;            /* contractivity of the resolved map */
  33.         int uniform;                    /* TRUE if map does uniform scaling */
  34.         short animated;                 /* TRUE if the map is animated */
  35.         int rang;                       /* for hierarchical IFS */
  36. } IfsMap;                         
  37.  
  38. struct IfsExtent {                      /* Ifs extent structure */
  39.         Float r, rsq;                   /* the extent is a sphere: r=radius */
  40.         Vector c;                       /*                         c=centre */
  41. };
  42.  
  43. typedef struct IfsOptions {                     /* options */
  44.         int depth;                      /* max recursion depth */
  45.         Float size;                     /* min extent size */
  46.         int normalweighting;            /* normal weighting method */
  47.     int boxbounding, spherebounding; /* box/sphere as bounding volume */
  48.     char *listfilename;    /* file to produce a list of volumes in */
  49. } IfsOptions;
  50.  
  51. typedef struct Ifs {    
  52.         IfsMap *maps;                    /* IFS maps */
  53.         int nrmaps;                     /* nr of Ifs maps */
  54.         int uniform_maps;               /* all maps do uniform scaling */
  55.         int frame;                      /* frame for which it is initialised */
  56.         Float contractivity,            /* max. contractivity of the maps */
  57.               size,                     /* estimated size of attractor */    
  58.               (*normalweight)(),        /* normal weighting function */
  59.               time;                     /* time for which the maps are resolved */
  60.         short animated;                 /* TRUE if maps are animated */
  61.         Geom *condensation;             /* condensation set */
  62.         Geom *leaves;                   /* leaves for Oppenheimer tree */
  63.     Float condensize, leavesize;    /* size of condensation & leaves */
  64.         Float bounds[2][3];             /* attractor bounding box */
  65.         struct IfsExtent extent;        /* tightly fitting sphere */
  66.     int boxbounding;        /* TRUE for using bounding box instead of sphere */
  67.         Vector normal, intersectpos;    /* hierarchically computed normal */
  68.         IfsOptions options;             /* options */
  69. } Ifs;
  70.  
  71. typedef struct TEList {                 /* Transformed Extent List */
  72.         RSMatrix matrix, imatrix;       /* transformation matrix and inverse */
  73.         Ray ray;                        /* inverse transformed ray */
  74.         Float   dist,                   /* distance to ray-origin */
  75.                 size,                   /* size of transformed extend */
  76.                 distfac;                /* ray stretching factor */
  77.         Vector normal;                  /* hierarchically computed normal */
  78.         int depth;                      /* recursion depth */
  79.         int rang;                       /* rang of map last used */
  80.         struct TEList *next, *prev;     /* doubly linked list */
  81. } TEList;
  82.  
  83. extern Ifs    *IfsCreate();
  84. extern Methods    *CIfsMethods(), *IfsMethods();
  85. extern int    CIfsIntersect(), IfsIntersect(), IfsEnter(), IfsNormal();
  86. extern void    IfsBounds(), CIfsStats(), IfsStats();
  87. extern char    *CIfsName(), *IfsName();
  88.  
  89. #endif /* IFS_H */
  90.  
  91.  
  92.  
  93.  
  94.  
  95.